package com.itheima.health.dao;

import com.itheima.health.pojo.OrderSetting;
import com.itheima.health.pojo.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;


@Mapper
public interface OrdersettingDto {
    /**
     * 插入Excel数据
     * @param orderDate
     * @param number
     */
    @Insert("INSERT INTO t_ordersetting (orderDate, number) VALUES (#{orderDate}, #{number});")
    void insert(Date orderDate, int number);
    /**
     * 搜索预约信息
     */
    @Select("select * from t_ordersetting where orderDate>=#{oneDayOfMonth} and orderDate <= #{endDayOfMonth}")
    List<OrderSetting> selectOrderSettingByMonth(LocalDate oneDayOfMonth, LocalDate endDayOfMonth);

    /**
     * 设置预约时间
     */
    @Update("UPDATE t_ordersetting SET  number = #{number} WHERE orderDate = #{orderDate}  ;")
    void editNumberByDate(Date orderDate, int number);





}
